<!-- DataTables -->
<link rel="stylesheet"
	  href="./app/lib/datatables/media/css/dataTables.bootstrap.css">
<div ng-controller="topicarticle as gt">
<section class="content-header">
	<h1>
		{{title}}<small></small>
	</h1>
</section>
<section class="content">
	<div class="box box-default">
		<div class="col-md-12">
			<div class="box-body" >
				<alertdanger></alertdanger>
				<alertsuccess></alertsuccess>
				<form role="form">
					<div class="box-body">

						<div ng-show=lasttopicshow class="form-group">
							<label>所选话题</label>
							<input maxlength="20" required="required"
								   ng-model="lasttopicname" class="form-control" type="text" readonly>
						</div>
						<div ng-show="modifylasttopicshow" class="form-group">
							<button class="btn btn-default btn-block btn-sm" ng-click="clickmodifytopic();">修改话题</button>
						</div>

						<div ng-show="topicshow" class="form-group" ng-init="findalltopic();">
							<label>所有话题</label>
							<select
								ng-model="selectedtopic"
									ng-options="gs.name for gs in topicselect"
								class="form-control select2" style="width: 100%;">
								<option ng－value="-1">--请选择--</option>
							</select>
						</div>

						<div class="form-group">
							<label>标题</label> <input maxlength="100" required="required"
								ng-model="topictitle" class="form-control" type="text"
								placeholder="请输入标题">
						</div>
						<div class="form-group">
							<label>作者</label> <input maxlength="100" ng-model="author"
								class="form-control" type="text" placeholder="请输入作者">
						</div>

						<div class="form-group">
							<label>摘要</label> <input maxlength="100" ng-model="tipcontent"
														class="form-control" type="text" placeholder="请输入摘要">
						</div>

						<div class="form-group">
							<label>搜索关键字</label> <input maxlength="100" ng-model="metakey"
								class="form-control" type="text" placeholder="请输入搜索关键字">
						</div>
						<div class="form-group">
							<label>搜索描述</label> <input maxlength="255" ng-model="metades"
								class="form-control" type="text" placeholder="请输入搜索描述">
						</div>

						<div class="form-group">
							<label>排序</label> <input maxlength="3" value="1"
								ng-model="sort" class="form-control" type="text"
								placeholder="请输入数字">
						</div>
						<div class="form-group">
							<label> <input type="radio" ng-model="msync"
								ng-value="1" class="flat-red" ng-checked="true">同步到移动端使用
							</label> <label> <input type="radio" ng-model="msync"
								ng-value="0" class="flat-red">只在电脑端使用
							</label>
						</div>
						<div class="form-group">
							<label> <input type="radio" ng-model="isrecommend"
										   ng-value="1" class="flat-red" ng-checked="true">推荐
							</label> <label> <input type="radio" ng-model="isrecommend"
													ng-value="0" class="flat-red">不推荐
						</label>
						</div>
						<div class="form-group">
							<label> <input type="radio" ng-model="istop"
										   ng-value="1" class="flat-red" ng-checked="true">置顶
							</label> <label> <input type="radio" ng-model="istop"
													ng-value="0" class="flat-red">不置顶
						</label>
						</div>


	                    <div class="form-group" >
	                      <label>正文</label>
	                      <div class="ueditor" ng-model="contentvalue"></div>
	                    </div>
	                    <textarea ng-model="contentvalue"></textarea>


						<div class="form-group">
							<label>主图</label>
							<div ngf-drop ngf-select ng-model="rmainfiles" class="drop-box"
								ngf-drag-over-class="'dragover'" ngf-multiple="true"
								ngf-allow-dir="true" accept="image/*" ngf-pattern="'image/*'">
								<button class="btn btn-default btn-block btn-sm">选择文件</button>
								<div ngf-no-file-drop>File Drag/Drop is not supported for
									this browser</div>
							</div>
							<div class='box-body'>
								<div class="progress progress-sm active">
									<div
										class="progress-bar progress-bar-success progress-bar-striped"
										role="progressbar" aria-valuenow="0" aria-valuemin="0"
										aria-valuemax="100" style="width: {{rmainprogress}}%">
										<span class="sr-only">20% Complete</span>
									</div>
								</div>
								<div ng-repeat="img in allrmainfiles">
									<div ng-if="img.isCloudImg">
										<div class="alert alert-success alert-dismissable">
											<button ng-click="removeallrmainfiles($index)" type="button" class="close"
												data-dismiss="alert" aria-hidden="true">&times;</button>

											<img class="img-responsive pad"
												ng-src="{{img.normalfilepath}}" alt="Photo">
											<div ng-if="img.compressfilepath!=null&&img.compressfilepath!==''"><img
													class="img-responsive pad" ng-src="{{img.compressfilepath}}"
													alt="Photo">
											</div>

										</div>
									</div>
									<div ng-if="!img.isCloudImg">
										<div class="alert alert-success alert-dismissable">
											<button ng-click="removeallrmainfiles($index)" type="button" class="close"
												data-dismiss="alert" aria-hidden="true">&times;</button>

											<img class="img-responsive pad"
												ng-src="{{img.basepath+img.normalfilepath}}" alt="Photo">

											<div ng-if="img.compressfilepath!=null&&img.compressfilepath!==''">
												<img class="img-responsive pad"
													 ng-src="{{img.basepath+img.compressfilepath}}" alt="Photo">
											</div>
										</div>


									</div>
								</div>

							</div>
						</div>

						<div class="form-group">
							<label>标签</label> <input maxlength="255" ng-model="topiclabels"
													   class="form-control" type="text" placeholder="请输入标签用逗号分隔">
						</div>
						<div class="form-group">
							<label> <input type="radio" ng-model="status"
										   ng-value="1" class="flat-red" ng-checked="true"> 启用
							</label> <label> <input type="radio" ng-model="status"
													ng-value="0" class="flat-red"> 禁用
						</label>

						</div>


					</div>
					<div class="box-footer">
						<button ng-show="savebtn.show" type="button"
							class="btn btn-primary" ng-click="save();">保存</button>
						<button ng-show="updatebtn.show" type="button"
							class="btn btn-primary" ng-click="update();">更新</button>
					</div>
				</form>
			</div>
		</div>
		<div class="box-footer"></div>
	</div>
</section>

</div>